/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package edi.dao;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
  

import java.util.List;
import edi.entities.DepartmentEntity;

@Repository
@Transactional
public class DepartmentDaoImp extends HibernateCrudDao<DepartmentEntity> implements DepartmentDao {
    
    public DepartmentDaoImp() {
	super(DepartmentEntity.class);
    }
        
    @Override
    public List<DepartmentEntity> findByCode(String code) {
	return session().createQuery("from UserEntity where depCode = :code").setString("code", code).list();
    } 
        
    @Override
    public List<DepartmentEntity> findByName(String name) {
	return session().createQuery("from UserEntity where depName = :name").setString("name", name).list();
    } 
        
            
}   



